package megamek.common.actions;

import org.junit.*;
import megamek.common.IGame;
import megamek.common.Aero;
import megamek.common.BipedMech;
import megamek.common.Targetable;
import megamek.common.ToHitData;
import megamek.common.Mounted;
import megamek.common.MiscType;
import megamek.common.Pilot;
import megamek.common.Game;
import megamek.common.Entity;
import megamek.common.EquipmentType;
import static org.junit.Assert.*;

/**
 * The class <code>ClubAttackActionTest</code> contains tests for the class <code>{@link ClubAttackAction}</code>.
 *
 * @generatedBy CodePro at 5/18/14 4:08 PM
 * @author Apar
 * @version $Revision: 1.0 $
 */
public class ClubAttackActionTest {
	/**
	 * Run the ClubAttackAction(int,int,Mounted,int) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testClubAttackAction_1()
		throws Exception {
		int entityId = 1;
		int targetId = 1;
		Mounted club = new Mounted(new Aero(), new EquipmentType());
		int aimTable = 1;

		ClubAttackAction result = new ClubAttackAction(entityId, targetId, club, aimTable);

		// add additional test code here
		assertNotNull(result);
		assertEquals(1, result.getTargetId());
		assertEquals(0, result.getTargetType());
		assertEquals(1, result.getEntityId());
	}

	/**
	 * Run the ClubAttackAction(int,int,int,Mounted,int) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testClubAttackAction_2()
		throws Exception {
		int entityId = 1;
		int targetType = 1;
		int targetId = 1;
		Mounted club = new Mounted(new Aero(), new EquipmentType());
		int aimTable = 1;

		ClubAttackAction result = new ClubAttackAction(entityId, targetType, targetId, club, aimTable);

		// add additional test code here
		assertNotNull(result);
		assertEquals(1, result.getTargetId());
		assertEquals(1, result.getTargetType());
		assertEquals(1, result.getEntityId());
	}

	/**
	 * Run the Mounted getClub() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetClub_1()
		throws Exception {
		ClubAttackAction fixture = new ClubAttackAction(1, 1, 1, new Mounted(new Aero(), new EquipmentType()), 1);

		Mounted result = fixture.getClub();

		// add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_1()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(-1, true);
		boolean targetInfantry = true;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_2()
		throws Exception {
		Aero entity = new Aero();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_3()
		throws Exception {
		Aero entity = new Aero();
		entity.crew = new Pilot();
		entity.heat = 9;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.ClassCastException: megamek.common.Aero cannot be cast to megamek.common.Mech
		//       at megamek.common.actions.ClubAttackAction.getDamageFor(ClubAttackAction.java:163)
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_4()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_5()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_6()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_7()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_8()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_9()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_10()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_11()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_12()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_13()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_14()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_15()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,Mounted,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testGetDamageFor_16()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.crew = new Pilot();
		entity.heat = 1;
		Mounted club = new Mounted(new Aero(), new MiscType());
		club.setLocation(1, true);
		boolean targetInfantry = false;

		int result = ClubAttackAction.getDamageFor(entity, club, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the void setClub(Mounted) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testSetClub_1()
		throws Exception {
		ClubAttackAction fixture = new ClubAttackAction(1, 1, 1, new Mounted(new Aero(), new EquipmentType()), 1);
		Mounted club = new Mounted(new Aero(), new EquipmentType());

		fixture.setClub(club);

		// add additional test code here
	}

	/**
	 * Run the ToHitData toHit(IGame) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Test
	public void testToHit_1()
		throws Exception {
		ClubAttackAction fixture = new ClubAttackAction(1, 1, 1, new Mounted(new Aero(), new EquipmentType()), 1);
		IGame game = new Game();

		ToHitData result = fixture.toHit(game);

		// add additional test code here
		assertNotNull(result);
	}

	/**
	 * Perform pre-test initialization.
	 *
	 * @throws Exception
	 *         if the initialization fails for some reason
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@Before
	public void setUp()
		throws Exception {
		// add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 *
	 * @throws Exception
	 *         if the clean-up fails for some reason
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	@After
	public void tearDown()
		throws Exception {
		// Add additional tear down code here
	}

	/**
	 * Launch the test.
	 *
	 * @param args the command line arguments
	 *
	 * @generatedBy CodePro at 5/18/14 4:08 PM
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(ClubAttackActionTest.class);
	}
}